package com.manes.agents;

import org.matheclipse.core.form.output.OutputFormFactory;
import org.matheclipse.core.form.output.StringBufferWriter;

import jade.core.AID;
import jade.core.Agent;
import jade.core.AgentContainer;
import jade.core.behaviours.CyclicBehaviour;
import jade.lang.acl.ACLMessage;
import jade.lang.acl.MessageTemplate;
import jade.wrapper.*;

import jade.domain.FIPAAgentManagement.*;
import jade.domain.DFService;
import jade.domain.FIPAException;

import com.manes.behaviours.*;
import com.manes.agents.*;
import edu.jas.kern.ComputerThreads;

public class jnessAgent extends Agent {

	/**
	 * 
	 */
	public AgentController t1 = null;
	private static final long serialVersionUID = 1L;
	public ACLMessage lastReceivedMsg;
	private MessageTemplate tmp = MessageTemplate.and(
			MessageTemplate.MatchPerformative(ACLMessage.INFORM),
			MessageTemplate.MatchOntology("mnsOnto"));

	/**
	 * adds the jnessBehaviour
	 */
	protected void setup() {
		// add the behaviour
		// 1 is the number of steps that must be executed at each run of
		// the Jess engine before giving back the control to the Java code
		addBehaviour(new BasicjnessBehaviour(this, "JadeAgent.clp", 1));

		ACLMessage msg = new ACLMessage(ACLMessage.INFORM);
		msg.addReceiver(new AID("Manes", AID.ISLOCALNAME));
		msg.setLanguage("English");
		msg.setOntology("mnsOnto");
		msg.setContent("jnessAgent agent online!");
		send(msg);

		
		
	}
	
}
